<template>
  <basic-container>
    <avue-tabs :option="tabsOption" @change="handleChange"></avue-tabs>
    <template v-if="tabsType.prop === '1'">
      <send-coupon :isShowCounts="isShowCounts" :ticketCode="ticketCode" />
    </template>
    <template v-else-if="tabsType.prop === '2'">
      <use-coupon :ticketCode="ticketCode" />
    </template>
  </basic-container>
</template>
  
  <script>
import sendCoupon from "./components/coupons/send-coupon";
import useCoupon from "./components/coupons/use-coupon";
export default {
  components: {
    sendCoupon,
    useCoupon,
  },
  data() {
    return {
      tabsType: {},
      tabsOption: {
        column: [
          {
            label: "发券详情",
            prop: "1",
          },
          {
            label: "使用详情",
            prop: "2",
          },
        ],
      },
      ticketCode: "",
      isShowCounts: true
    };
  },
  computed: {},
  watch: {
    "$route.query": {
      handler(val) {
        if (val) {
          this.ticketCode = val.ticketCode
        }
      },
      immediate: true,
    },
  },
  created() {
    this.tabsType = this.tabsOption.column[0];
  },
  methods: {
    handleChange(column) {
      this.tabsType = column;
      // this.$message.success(JSON.stringify(column));
    },
  },
};
</script>
  
<style>
</style>